package cc.yugu.yhdw.common.domain.basic;

import cc.yugu.yhdw.common.annotation.Transient;
import cc.yugu.yhdw.common.domain.IntIdEntity;
import cc.yugu.yhdw.common.entity.json.DateTimeSerializer;
import org.codehaus.jackson.map.annotate.JsonSerialize;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 角色
 *
 * @Date:Created in 2018/7/25 14:21
 * @Author:
 * @Modified By: zjn 2018/7/25 14:21
 */
public class Role extends IntIdEntity {

    Integer agentId;   //代理商ID
    String roleName; //角色名称
    String memo; //备注
    Date createTime; //创建时间
    String agentName;
    @Transient
    List<Integer> operList = new ArrayList<Integer>(); //角色保护的oper

    public String getAgentName() {
        return agentName;
    }

    public void setAgentName(String agentName) {
        this.agentName = agentName;
    }

    public Integer getAgentId() {
        return agentId;
    }

    public void setAgentId(Integer agentId) {
        this.agentId = agentId;
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    //注意：从数据库取出的Date类型时间需要进行转换（Date类型转换成 JSON类型）
    @JsonSerialize(using = DateTimeSerializer.class)
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public List<Integer> getOperList() {
        return operList;
    }

    public void setOperList(List<Integer> operList) {
        this.operList = operList;
    }

}
